/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package xlaucher;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author Ytong
 */
public class ConfigController {
    public static void WriteConfig(String name,String Memory) throws JSONException, IOException{
        JSONObject json=new JSONObject();
        json.put("name", name);
        json.put("Memory", Memory);
        File f=new File(Use.rundir()+"/config.json");
        if(f.exists())
            f.delete();
        FileWriter w=new FileWriter(f);
        w.write(json.toString());
        
        
    }
    public static void readConfig(String name,String memory) throws IOException, JSONException{
    JSONObject json=new JSONObject(Use.readfile(Use.rundir()+"/config.json"));

       
      name=json.getString("name");
      name=json.getString("Memory");
    }
}
